<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"  >

<h:head>
	<title>
		<h:outputText value="#{msg['mrh.sigla.sistema']}" /> 
		<h:outputText value=" - " /> 
		<h:outputText value="#{msg['mrh.nome.sistema']}" />
	</title>
	
	<h:outputStylesheet library="css" name="geral.css" />
	<h:outputStylesheet library="css" name="login.css" />
	
	<link href="resources/img/icon.ico" rel="shortcut icon" type="image/x-icon"/>
	
</h:head>

<h:body>

<p:messages id="msg" showDetail="false"/>

	<div id="main">
		
		<p:dialog 	id="mdlAlterarSenha" 
					header="#{msg['mrh.texto.alterar.senha']}" 
					widgetVar="dlgAlterar" 
					modal="true" 
					closable="false" 
					resizable="false" 
					width="420"
					styleClass="login-modal" >
			
			<h:form id="formAlterar" styleClass="modal" prependId="false">
			
				<div class="login-box-modal">
					
					<h:panelGrid columns="1">
						
						<div align="center">
						  
							<h:panelGrid columns="2" cellpadding="5" cellspacing="5">
							
								<h:panelGroup>
									<div id="login-box-name">
										<h:outputLabel value="#{msg['mrh.label.nome.usuario']}" for="UsuarioAlteracao" />
									</div>
								</h:panelGroup>
								
								<h:panelGroup>
									<div id="login-box-field">
										<h:panelGrid columns="2">
											<h:panelGroup>
												<div id="login-box-field">
													<p:inputText id="UsuarioAlteracao" value="#{acessoSistemaBean.usuarioAlteraSenha.cdUsuario}" styleClass="form-login" size="30" maxlength="30" />
												</div>
											</h:panelGroup>
											<h:outputText value="#{msg['mrh.texto.obrigatorio']}" styleClass="obrigatorio" />
										</h:panelGrid>
									</div>
								</h:panelGroup>
								
								<h:panelGroup>
									<div id="login-box-name">
										<h:outputLabel value="#{msg['mrh.label.senha.atual']}" for="SenhaAtual" />
									</div>
								</h:panelGroup>
								
								<h:panelGroup>
									<div id="login-box-field">
										<h:panelGrid columns="2">
											<h:panelGroup>
												<div id="login-box-field">
													<p:password id="SenhaAtual" value="#{acessoSistemaBean.usuarioAlteraSenha.cdSenha}" styleClass="form-login" size="30" maxlength="20"/>
												</div>
											</h:panelGroup>
											<h:outputText value="#{msg['mrh.texto.obrigatorio']}" styleClass="obrigatorio" />
										</h:panelGrid>
									</div>
								</h:panelGroup>
								
								<h:panelGroup>
									<div id="login-box-name">
										<h:outputLabel value="#{msg['mrh.label.nova.senha']}" for="NovaSenha" />
									</div>
								</h:panelGroup>
								
								<h:panelGroup>
									<div id="login-box-field">
										<h:panelGrid columns="2">
											<h:panelGroup>
												<div id="login-box-field">
													<p:password id="NovaSenha" value="#{acessoSistemaBean.usuarioAlteraSenha.cdNovaSenha}" styleClass="form-login" size="30" maxlength="20"/>
												</div>
											</h:panelGroup>
											<h:outputText value="#{msg['mrh.texto.obrigatorio']}" styleClass="obrigatorio" />
										</h:panelGrid>
									</div>
								</h:panelGroup>
								
								<h:panelGroup>
									<div id="login-box-name">
										<h:outputLabel value="#{msg['mrh.label.confirma.senha']}" for="ConfirmaSenha" />
									</div>
								</h:panelGroup>
								
								<h:panelGroup>
									<div id="login-box-field">
										<h:panelGrid columns="2">
											<h:panelGroup>
												<div id="login-box-field">
													<p:password id="ConfirmaSenha" value="#{acessoSistemaBean.usuarioAlteraSenha.cdConfirmaSenha}" styleClass="form-login" size="30" maxlength="20"/>
												</div>
											</h:panelGroup>
											<h:outputText value="#{msg['mrh.texto.obrigatorio']}" styleClass="obrigatorio" />
										</h:panelGrid>
									</div>
								</h:panelGroup>
								
							</h:panelGrid>
						
						</div>
						
					</h:panelGrid>
					
					<div align="center">
					
						<h:panelGrid columns="2" cellspacing="5">
							
							<h:panelGroup>
								<div align="center" style="width: 100%; text-align: center;"> 
									<p:commandButton value="#{msg['mrh.botao.alterar']}" action="#{acessoSistemaBean.doChangePassword}" oncomplete="dlgAlterar.hide()" styleClass="button" update="@form,@all,:msg"/>
								</div>
							</h:panelGroup>
							
							<h:panelGroup>
								<div align="center" style="width: 100%; text-align: center;"> 
									<p:commandButton value="#{msg['mrh.botao.cancelar']}" action="#{acessoSistemaBean.doCleanUsuario}" styleClass="button" update="@form,@all,:msg" onclick="dlgAlterar.hide()"/>
								</div>
							</h:panelGroup>
							
						</h:panelGrid>
					
					</div>
					
				</div>
			
			</h:form>
    			  
		</p:dialog>
		
		<p:dialog 	id="mdlRecuperarSenha" 
					header="#{msg['mrh.texto.recuperar.senha']}" 
					widgetVar="dlgRecuperar" 
					modal="true" 
					closable="false" 
					resizable="false" 
					width="390"
					styleClass="login-modal" >
			
			<h:form id="formRecuperar" styleClass="modal" prependId="false">
			
				<div class="login-box-modal">
					
					<h:panelGrid columns="1">
					  
						<h:panelGrid columns="2" cellspacing="5">
						
							<h:panelGroup>
								<div id="login-box-name">
									<h:outputLabel value="#{msg['mrh.label.nome.usuario']}" for="UsuarioRecuperar" />
								</div>
							</h:panelGroup>
							
							<h:panelGroup>
								<div id="login-box-field">
									<h:panelGrid columns="2">
										<p:inputText id="UsuarioRecuperar" value="#{acessoSistemaBean.usuario.cdUsuario}" styleClass="form-login" size="30" maxlength="30" />
										<h:outputText value="#{msg['mrh.texto.obrigatorio']}" styleClass="obrigatorio" />
									</h:panelGrid>
								</div>
							</h:panelGroup>
							
						</h:panelGrid>
						
					</h:panelGrid>
					
					<div align="center">
					
						<h:panelGrid columns="2" cellspacing="5">
							
							<h:panelGroup>
								<div align="center" style="width: 100%; text-align: center;"> 
									<p:commandButton value="#{msg['mrh.botao.recuperar']}" action="#{acessoSistemaBean.doRecoverPassword}" oncomplete="dlgRecuperar.hide()" styleClass="button" update="@form,@all,:msg" />
								</div>
							</h:panelGroup>
							
							<h:panelGroup>
								<div align="center" style="width: 100%; text-align: center;"> 
									<p:commandButton value="#{msg['mrh.botao.cancelar']}" action="#{acessoSistemaBean.doCleanUsuario}" styleClass="button" onclick="dlgRecuperar.hide()"/>
								</div>
							</h:panelGroup>
							
						</h:panelGrid>
					
					</div>
					
				</div>
			
			</h:form>
    			  
		</p:dialog>
		
		<h:form id="formPrincipal" prependId="false">
			
			<div id="login-box" align="center">
				
				<div id="login" align="center">
				
					<h:panelGrid columns="1" cellpadding="5" cellspacing="5">
						
						<h:panelGroup>
								<h3>
									<h:outputText value="#{msg['mrh.nome.sistema']}" />
								</h3>
								<h4>
									<h:outputText value="#{msg['mrh.pag.acesso.sistema']}" />
								</h4>
						</h:panelGroup>
		
						<h:panelGrid columns="2" cellpadding="5">
						
							<h:panelGroup >
								<div id="login-box-name">
									<h:outputLabel value="#{msg['mrh.label.nome.usuario']}" for="Usuario" />
								</div>
							</h:panelGroup>
							
							<h:panelGroup>
								<div id="login-box-field">
									<h:panelGrid columns="2">
										<p:inputText id="Usuario" value="#{acessoSistemaBean.usuario.cdUsuario}" styleClass="form-login" size="30" maxlength="30" />
										<h:outputText value="#{msg['mrh.texto.obrigatorio']}" styleClass="obrigatorio" />
									</h:panelGrid>
								</div>
							</h:panelGroup>
							
							<h:panelGroup>
								<div id="login-box-name">
									<h:outputLabel value="#{msg['mrh.label.senha.usuario']}" for="Senha" />
								</div>
							</h:panelGroup>
							
							<h:panelGroup>
								<div id="login-box-field">
									<h:panelGrid columns="2">
										<p:password id="Senha" value="#{acessoSistemaBean.usuario.cdSenha}" styleClass="form-login" size="30" maxlength="20" />
										<h:outputText value="#{msg['mrh.texto.obrigatorio']}" styleClass="obrigatorio" />
									</h:panelGrid>
								</div>
							</h:panelGroup>
							
						</h:panelGrid>
						
						<h:panelGroup>
							
							<div align="center">
							
								<h:panelGrid columns="2">
								
									<h:panelGroup>
										<div>
											<p:commandButton  value="#{msg['mrh.botao.entrar']}" action="#{acessoSistemaBean.doLogin}" styleClass="button" ajax="false" />
										</div>
									</h:panelGroup>
								
									<h:panelGroup>
										<div>
											<p:commandButton  value="#{msg['mrh.botao.limpar']}" action="#{acessoSistemaBean.doCleanUsuario}" styleClass="button" ajax="false" />
										</div>
									</h:panelGroup>
									
								</h:panelGrid>
							
							</div>
							
						</h:panelGroup>
						
					</h:panelGrid>
					
				</div>
				
				<div style="clear: both; height: 40px;"></div>
				
				<div style="bottom: 0%">
				
					<div style="float: left; margin-left: 10%;">
						<p:commandLink value="#{msg['mrh.texto.recuperar.senha']}" onclick="dlgRecuperar.show()"/>
					</div>
				
					<div style="float: right; margin-right: 10%;">
						<p:commandLink value="#{msg['mrh.texto.alterar.senha']}" onclick="dlgAlterar.show()"/>
					</div>
				
				</div>
							
			</div>
			
			<div class="linguage-form" align="center">
				
				<div class="bandeira">
				
					<p:commandLink id="btnBR" styleClass="bandeira-link"  action="#{linguaBean.alterarLinguaBR}" ajax="false">
						<div class="bandeira-br"></div>
					</p:commandLink>
					
					<p:commandLink id="btnUS" styleClass="bandeira-link" action="#{linguaBean.alteraLinguaUS}" ajax="false">
						<div class="bandeira-us"></div>
					</p:commandLink>
					
				</div>
							
			</div>
		
		</h:form>
		
	</div>
	
</h:body>

</html>